<template>
    <el-row
        :gutter="10"
        style="text-align: center"
        class="dashboard"
    >
        <!--    第一行数据显示-->
        <div
            style="cursor:pointer;color: white;border-radius: 15px;height: 100px;width: 200px;margin: 25px;display: inline-block;background-color: #03B8CF"
            class="box-card"
            @click="$router.push('/admin/postManage')"
        >
            <div style="height: 40px;line-height: 40px">
                {{ this.indexData.indexList[0] }}
            </div>
            <div style="height: 60px;line-height: 60px;font-weight: bold;font-size: 35px">
                {{ dataSummaty.postNum }}
            </div>
        </div>
        <div
            style="cursor:pointer;color: white;border-radius: 15px;height: 100px;width: 200px;margin: 25px;display: inline-block;background-color: #039BE5"
            class="box-card"
            @click="$router.push('/admin/unemployedRate')"
        >
            <div style="height: 40px;line-height: 40px">
                {{ this.indexData.indexList[1] }}
            </div>
            <div style="height: 60px;line-height: 60px;font-weight: bold;font-size: 35px">
                {{ this.dataSummaty.unemployedNum }}
            </div>
        </div>
        <div
            style="cursor:pointer;color: white;border-radius: 15px;height: 100px;width: 200px;margin: 25px;display: inline-block;background-color: #F1A325"
            class="box-card"
            @click="$router.push('/admin/studentData?employmentStatus=已就业')"
        >
            <div style="height: 40px;line-height: 40px">
                {{ this.indexData.indexList[2] }}
            </div>
            <div style="height: 60px;line-height: 60px;font-weight: bold;font-size: 35px">
                {{ this.dataSummaty.forEmploymentNum }}
            </div>
        </div>
        <div
            style="cursor:pointer;color: white;border-radius: 15px;height: 100px;width: 200px;margin: 25px;display: inline-block;background-color: #294D99"
            class="box-card"
            @click="$router.push('/admin/studentData')"
        >
            <div style="height: 40px;line-height: 40px">
                {{ this.indexData.indexList[3] }}
            </div>
            <div style="height: 60px;line-height: 60px;font-weight: bold;font-size: 35px">
                {{ this.dataSummaty.studentNum }}
            </div>
        </div>
        <!--    第二行数据显示-->
        <div
            style="cursor:pointer;color: white;border-radius: 15px;height: 100px;width: 200px;margin: 25px;display: inline-block;background-color: #6144D4"
            class="box-card"
            @click="$router.push('/admin/professionManage')"
        >
            <div style="height: 40px;line-height: 40px">
                {{ this.indexData.indexList[4] }}
            </div>
            <div style="height: 60px;line-height: 60px;font-weight: bold;font-size: 35px">
                {{ this.dataSummaty.proNum }}
            </div>
        </div>
        <div
            style="cursor:pointer;color: white;border-radius: 15px;height: 100px;width: 200px;margin: 25px;display: inline-block;background-color: #3C3C3C"
            class="box-card"
            @click="$router.push('/admin/classesManage')"
        >
            <div style="height: 40px;line-height: 40px">
                {{ this.indexData.indexList[5] }}
            </div>
            <div style="height: 60px;line-height: 60px;font-weight: bold;font-size: 35px">
                {{ this.dataSummaty.classNum }}
            </div>
        </div>
        <div
            style="cursor:pointer;color: white;border-radius: 15px;height: 100px;width: 200px;margin: 25px;display: inline-block;background-color: #00C397"
            class="box-card"
            @click="$router.push('/admin/studentData?sex=男')"
        >
            <div style="height: 40px;line-height: 40px">
                {{ this.indexData.indexList[6] }}
            </div>
            <div style="height: 60px;line-height: 60px;font-weight: bold;font-size: 35px">
                {{ this.dataSummaty.boyNum }}
            </div>
        </div>
        <div
            style="cursor:pointer;color: white;border-radius: 15px;height: 100px;width: 200px;margin: 25px;display: inline-block;background-color: #EA644A"
            class="box-card"
            @click="$router.push('/admin/studentData?sex=女')"
        >
            <div style="height: 40px;line-height: 40px">
                {{ this.indexData.indexList[7] }}
            </div>
            <div style="height: 60px;line-height: 60px;font-weight: bold;font-size: 35px">
                {{ this.dataSummaty.girlNum }}
            </div>
        </div>
    </el-row>
</template>
<script>
    export default {
        data () {
            return {
                // 首页数据
                indexData: {
                    postNum: 0,
                    unemployedNum: 0,
                    forEmploymentNum: 0,
                    studentNum: 0,
                    proNum: 0,
                    classNum: 0,
                    boyNum: 0,
                    girlNum: 0,
                    indexList: ['企业岗位数', '未就业人数', '已就业人数', '学生总人数', '专业总个数', '班级总个数', '男生总人数', '女生总人数']
                },
                dataSummaty: {
                    postNum: 0,
                    unemployedNum: 0,
                    forEmploymentNum: 0,
                    studentNum: 0,
                    proNum: 0,
                    classNum: 0,
                    boyNum: 0,
                    girlNum: 0
                }

            }
        },
        mounted () {
            this.getIndexData()
        },
        methods: {
            getIndexData () {
                let self = this
                self.utils.sendReq({
                    queryUrl: '/data/getDataSummary',
                    req: {
                        method: 'get',
                        success: function (req) {
                            if (req.data.code === 200) {
                                let data = req.data.data
                                self.dataSummaty.postNum = data.postNum
                                self.dataSummaty.unemployedNum = data.unemployedNum
                                self.dataSummaty.forEmploymentNum = data.forEmploymentNum
                                self.dataSummaty.studentNum = data.studentNum
                                self.dataSummaty.proNum = data.proNum
                                self.dataSummaty.classNum = data.classNum
                                self.dataSummaty.boyNum = data.boyNum
                                self.dataSummaty.girlNum = data.girlNum
                            }
                        }
                    }
                })
            }
        }
    }
</script>
<style lang="less" scoped>
</style>
